/*
 *    Copyright © OpenAtom Foundation.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.inspur.edp.bff.spi.event.retrieve;

import com.inspur.edp.bef.api.lcp.AuthInfo;
import com.inspur.edp.bef.api.parameter.retrieve.RetrieveParam;
import com.inspur.edp.bff.api.manager.IFSAction;
import com.inspur.edp.bff.api.manager.IFSManagerContext;
import com.inspur.edp.bff.api.manager.context.QueryContext;
import com.inspur.edp.cef.entity.condition.EntityFilter;
import com.inspur.edp.cef.entity.entity.IEntityData;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public interface IBffRetrieveEventListener {
    public void beforeRetrieve(IFSManagerContext bffcontext, ArrayList<String> dataIds, RetrieveParam retrieveParam);

    //检索前扩展动作
    public void beforeTotalCXQAssembler(QueryContext querycontext);

    public void beforeCXQAssembler(IFSAction beforeaction, QueryContext querycontext, IFSManagerContext bffcontext);

    public void afterCXQAssembler(IFSManagerContext bffcontext, QueryContext queryContext);

    public void afterTotalCXQAssembler(IFSManagerContext bffcontext, QueryContext queryContext, int TotalCount);

    //查询
    public void beforeWKZTotalCoreQuery(EntityFilter filter);

    public void afterWKZTotalCoreQuery(IFSManagerContext bffcontext, List<IEntityData> queryResult, List<IEntityData> vmdatas);

    public void beforeTotalCoreQuery(QueryContext querycontext);

    public void beforeCoreQuery(IFSAction queryaction, QueryContext querycontext, IFSManagerContext bffcontext);

    public void processGetAuth(AuthInfo auth, String auvoid, String auconfigid);

    public void afterCoreQuery(IFSManagerContext context, HashMap<String, ArrayList<IEntityData>> queryResult, QueryContext queryContext);

    public void afterTotalCoreQuery(IFSManagerContext context, HashMap<String, ArrayList<IEntityData>> queryResult, QueryContext queryContext, int TotalCount);


    //查询后扩展动作
    public void beforeTotalCXHAssembler(QueryContext queryContext, IFSManagerContext bffcontext);

    public void beforeCXHAssembler(IFSAction cxhassembler, QueryContext queryContext, IFSManagerContext bffcontext);

    public void afterCXHAssembler(QueryContext queryContext, IFSManagerContext bffcontext);

    public void afterTotalCXHAssembler(QueryContext queryContext, IFSManagerContext bffcontext, int TotalCount);

    public void afterQuery(IFSManagerContext context, EntityFilter filter, List<IEntityData> result);

    public void queryUnnormalStop(Exception e);

}
